a2b126dec3e9e4f95b152bd735ca491f5e1ce7f5,clustered/server/src/main/java/org/ehcache/clustered/server/store/ClusterTierActiveEntity.java,ClusterTierActiveEntity,invokeServerStoreOperation,#ClientDescriptor#ServerStoreOpMessage#,289
Before Change
// after all handleReconnects are done, else this is flawed.
if (inflightInvalidations != null) {
LOGGER.debug("Stalling all operations for cache {} for firing inflight invalidations again.", storeIdentifier);
inflightInvalidations.forEach(invalidationState -> {
if (invalidationState.isClearInProgress()) {
invalidateAll(invalidationState.getClientDescriptor());
}
invalidationState.getInvalidationsInProgress()
.forEach(hashInvalidationToBeResent -> invalidateHashForClient(invalidationState.getClientDescriptor(), hashInvalidationToBeResent));
});
inflightInvalidations = null;
}
After Change
synchronized (inflightInvalidationsMutex) {
// This logic totally counts on the fact that invokes will only happen
// after all handleReconnects are done, else this is flawed.
if (inflightInvalidations != null) {
List<InvalidationTuple> tmpInflightInvalidations = this.inflightInvalidations;
this.inflightInvalidations = null;
LOGGER.debug("Stalling all operations for cluster tier {} for firing inflight invalidations again.", storeIdentifier);
tmpInflightInvalidations.forEach(invalidationState -> {
if (invalidationState.isClearInProgress()) {
invalidateAll(invalidationState.getClientDescriptor());
}
invalidationState.getInvalidationsInProgress()
.forEach(hashInvalidationToBeResent -> invalidateHashForClient(invalidationState.getClientDescriptor(), hashInvalidationToBeResent));
});
}
}
}